Gate ostree-trivial-httpd on BUILDOPT_TRIVIAL_HTTPD
authorAlex Kiernan <alex.kiernan@gmail.com>
Thu, 5 Sep 2019 12:22:15 +0000 (13:22 +0100)
committerAlex Kiernan <alex.kiernan@gmail.com>
Wed, 9 Oct 2019 05:04:54 +0000 (06:04 +0100)
When building without --enable-trivial-httpd-cmdline, don't build or install
the ostree-trivial-httpd binary.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Makefile-ostree.am
configure.ac

index 76f39cad4b746b68376813c20858143d6989fc3d..7b53cb148960e9d7e9517510ebc30f2fafef0d9e 100644 (file)
@@ -143,12 +143,13 @@ ostree_SOURCES += src/ostree/ot-builtin-pull.c
 endif
 
 if USE_LIBSOUP
-# Eventually once we stop things from using this, we should support disabling this
+if BUILDOPT_TRIVIAL_HTTPD
 ostree_SOURCES += src/ostree/ot-builtin-trivial-httpd.c
 pkglibexec_PROGRAMS += ostree-trivial-httpd
 ostree_trivial_httpd_SOURCES = src/ostree/ostree-trivial-httpd.c
 ostree_trivial_httpd_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_SOUP_CFLAGS)
 ostree_trivial_httpd_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_SOUP_LIBS)
+endif
 
 if !USE_CURL
 # This is necessary for the cookie jar bits
index 6861afb87be9d1ac1a0cdbfef0344373723a3275..e009d6b2e95a924e67a2b0c15802f810313388ea 100644 (file)
@@ -195,6 +195,9 @@ AC_ARG_ENABLE(trivial-httpd-cmdline,
   [Continue to support "ostree trivial-httpd" [default=no]])],,
   enable_trivial_httpd_cmdline=no)
 AM_CONDITIONAL(BUILDOPT_TRIVIAL_HTTPD, test x$enable_trivial_httpd_cmdline = xyes)
+AS_IF([test x$with_soup = xno && test x$enable_trivial_httpd_cmdline = xyes], [
+  AC_MSG_ERROR([trivial-httpd enabled, but libsoup is not; libsoup is needed for trivial-httpd])
+])
 AM_COND_IF(BUILDOPT_TRIVIAL_HTTPD,
   [AC_DEFINE([BUILDOPT_ENABLE_TRIVIAL_HTTPD_CMDLINE], 1, [Define if we are enabling ostree trivial-httpd entrypoint])]
 )